use std::collections::HashSet;
use crate::solution::Solution;

impl Solution {
    pub fn check_valid(matrix: Vec<Vec<i32>>) -> bool {
        let mut mp=HashSet::new();
        for i in 0..matrix.len(){
            for j in 0..matrix.len(){
                mp.insert(matrix[i][j]);
            }
            if mp.len()!=matrix.len(){
                return  false;
            }
            mp.clear();
        };
        for i in 0..matrix.len(){
            for j in 0..matrix.len(){
                mp.insert(matrix[j][i]);
            }
            if mp.len()!=matrix.len(){
                return  false;
            }
            mp.clear();
        };
        true
    }
        
    }